﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EZCRS.HCMS.Web;
using EZCRS.HCMS.Bll;
using EZCRS.HCMS.Bll.baseinfo;

using EZCRS.HCMS.Entity;

namespace EZCRS.HCMS.Web.manage.AIR
{
    public partial class InventoryPlanDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    int iID = 0;
                    int.TryParse(Request.QueryString["id"], out iID);

                    BindData(iID);

                }
            }
        }

        private void BindData(int ID)
        {
            EZCRS.HCMS.Bll.AIR.InventoryPlan invPlan = new EZCRS.HCMS.Bll.AIR.InventoryPlan();

            HCRS_InventoryPlan plan = invPlan.GetItem(ID);

            if (plan == null) return;

            lblID.Text = plan.ID.ToString();
            lblCrateDate.Text = plan.CrateDate.ToString();
            lblStart.Text = plan.StartDate.ToString("yyyy-MM-dd");
            lblEnd.Text = plan.EndDate.ToString("yyyy-MM-dd");

            lblRoomCode.Text = plan.RoomCode;
            lblPlanCode.Text = plan.PlanCode;
            lblQuota.Text = plan.PlanQuota + "%";

            lblMin.Text = plan.Min.ToString();
            lblMax.Text = plan.Max.ToString();
            lblAdv.Text = plan.AdvanceHour.ToString();
            lblRoomState.Text = plan.State;

            lblRoomAmount.Text = plan.RoomInventory.ToString();

            lblWeek.Text = plan.WeekString;

        }
    }
}
